import QtQuick 2.12
import Qt.labs.platform 1.0


SystemTrayIcon
{
    id:systemTray
    iconSource: "qrc:/images/music"
    visible: true
    onActivated:
    {
        window.show()
        window.raise()
        window.requestActivate()
    }
    menu: Menu
    {
        id:menu
        MenuItem
        {
            text: "上一曲"
            onTriggered:
            {
                layoutBottomView.playPrevious()
            }
        }

        MenuItem
        {
            text: layoutBottomView.playingState===0?"播放":"暂停"
            onTriggered:
            {
                layoutBottomView.playOrPause()
            }
        }

        MenuItem
        {
            text: "下一曲"
            onTriggered:
            {
                layoutBottomView.playNext()
            }
        }
        MenuItem
        {
            text: "显示"
            onTriggered:
            {
                window.show()
            }
        }
        MenuSeparator
        {

        }

        MenuItem
        {
            text: "退出"
            onTriggered:
            {
                Qt.quit()
            }
        }
    }
}
